package com.ruoyi.process.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.mapper.WorkFertilizeMapper;
import com.ruoyi.process.domain.WorkFertilize;
import com.ruoyi.process.service.IWorkFertilizeService;

/**
 * 施肥管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class WorkFertilizeServiceImpl implements IWorkFertilizeService 
{
    @Autowired
    private WorkFertilizeMapper workFertilizeMapper;

    /**
     * 查询施肥管理
     * 
     * @param workFertilizeId 施肥管理ID
     * @return 施肥管理
     */
    @Override
    public WorkFertilize selectWorkFertilizeById(Long workFertilizeId)
    {
        return workFertilizeMapper.selectWorkFertilizeById(workFertilizeId);
    }

    /**
     * 查询施肥管理列表
     * 
     * @param workFertilize 施肥管理
     * @return 施肥管理
     */
    @Override
    public List<WorkFertilize> selectWorkFertilizeList(WorkFertilize workFertilize)
    {
        return workFertilizeMapper.selectWorkFertilizeList(workFertilize);
    }

    /**
     * 新增施肥管理
     * 
     * @param workFertilize 施肥管理
     * @return 结果
     */
    @Override
    public int insertWorkFertilize(WorkFertilize workFertilize)
    {
        workFertilize.setCreateTime(DateUtils.getNowDate());
        return workFertilizeMapper.insertWorkFertilize(workFertilize);
    }

    /**
     * 修改施肥管理
     * 
     * @param workFertilize 施肥管理
     * @return 结果
     */
    @Override
    public int updateWorkFertilize(WorkFertilize workFertilize)
    {
        workFertilize.setUpdateTime(DateUtils.getNowDate());
        return workFertilizeMapper.updateWorkFertilize(workFertilize);
    }

    /**
     * 批量删除施肥管理
     * 
     * @param workFertilizeIds 需要删除的施肥管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkFertilizeByIds(Long[] workFertilizeIds)
    {
        return workFertilizeMapper.deleteWorkFertilizeByIds(workFertilizeIds);
    }

    /**
     * 删除施肥管理信息
     * 
     * @param workFertilizeId 施肥管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkFertilizeById(Long workFertilizeId)
    {
        return workFertilizeMapper.deleteWorkFertilizeById(workFertilizeId);
    }
}
